package lab02;
interface Boss{
    void attack();
    void move();
    void recoveryHealth();

}
class Golem implements Boss{
        String name = "Golem";
        int health = 200;

    @Override
    public void attack() {
        System.out.println("名字："+name+"当前血量："+health);
        System.out.println(name+"发动攻击！");
    }
    @Override
    public void move() {
        System.out.println("Boss移动方式：曲线移动");
    }
    @Override
    public void recoveryHealth() {
        health +=20;
        System.out.println(name+"回血成功当前血量为："+health);
    }
}
class Zelos implements Boss{
    String name = "Zelos";
    int health = 300;


    public void attack() {
        System.out.println("名字："+name+"当前血量："+health);
        System.out.println(name+"发动攻击！");
    }


    @Override
    public void move() {
        System.out.println("Boss移动方式：飞行移动");
    }


    @Override
    public void recoveryHealth() {
        health += 30;
        System.out.println(name+"回血成功当前血量为："+health);
    }
}
public class Test {
    public static void main(String[] args) {
        Golem golem = new Golem();
        System.out.println("Boss名称："+golem.name+" 当前血量："+golem.health);
        golem.move();
        golem.attack();
        System.out.println("-----------------------------------");
        Zelos zelos = new Zelos();
        System.out.println("Boss名称："+zelos.name+" 当前血量："+zelos.health);
        zelos.move();
        zelos.attack();
        if (golem.health<10){
            golem.recoveryHealth();
        }
        if (zelos.health<10){
            zelos.recoveryHealth();
        }
    }
}
//Boss名称：Golem 当前血量：200
//Boss移动方式：曲线移动
//名字：Golem当前血量：200
//Golem发动攻击！
//-----------------------------------
//Boss名称：Zelos 当前血量：300
//Boss移动方式：飞行移动
//名字：Zelos当前血量：300
//Zelos发动攻击！